package com.ssm.pre.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ssm.pre.service.LifeService;
import com.ssm.util.object.InputObject;
import com.ssm.util.object.OutputObject;

/**
 * 生活缴费
 * @author mps
 *
 */
@Controller
public class LifeController {

	@Autowired
	private LifeService lifeService;
	
	/**
	 * 查询物业缴费记录
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/LifeController/queryPropertyFee")
	@ResponseBody
	public void queryPropertyFee(InputObject inputObject, OutputObject outputObject) throws Exception{
		lifeService.queryPropertyFee(inputObject, outputObject);
	}
	
	/**
	 * 查询电费缴费记录
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/LifeController/queryElectricFee")
	@ResponseBody
	public void queryElectricFee(InputObject inputObject, OutputObject outputObject) throws Exception{
		lifeService.queryElectricFee(inputObject, outputObject);
	}
	
	/**
	 * 微信支付物业费
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/gateway/LifeController/addPropertyFee")
	@ResponseBody
	public void addPropertyFee(InputObject inputObject, OutputObject outputObject) throws Exception{
		lifeService.addPropertyFee(inputObject, outputObject);
	}
	
	/**
	 * 更改支付状态：改为支付成功的状态
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/gateway/LifeController/updatePropertyState")
	@ResponseBody
	public void updatePropertyState(InputObject inputObject, OutputObject outputObject) throws Exception{
		lifeService.updatePropertyState(inputObject, outputObject);
	}
	
	/**
	 * 微信端查询物业费账单
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/gateway/LifeController/queryWechatPropertyByList")
	@ResponseBody
	public void queryWechatPropertyByList(InputObject inputObject, OutputObject outputObject) throws Exception{
		lifeService.queryWechatPropertyByList(inputObject, outputObject);
	}
	
	/**
	 * 微信端查询电费账单
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/gateway/LifeController/queryWechatElectricByList")
	@ResponseBody
	public void queryWechatElectricByList(InputObject inputObject, OutputObject outputObject) throws Exception{
		lifeService.queryWechatElectricByList(inputObject, outputObject);
	}
	
	/**
	 * 微信支付电费
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/gateway/LifeController/addEclectricFee")
	@ResponseBody
	public void addEclectricFee(InputObject inputObject, OutputObject outputObject)throws Exception{
		lifeService.addEclectricFee(inputObject, outputObject);
	}
	
	/**
	 * 微信端根据房屋编号(3#-1-102)查询用电量
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/gateway/LifeController/queryEclectricFeeByNumber")
	@ResponseBody
	public void queryEclectricFeeByNumber(InputObject inputObject, OutputObject outputObject)throws Exception{
		lifeService.queryEclectricFeeByNumber(inputObject, outputObject);
	}
	
	/**
	 * 更改电费的支付状态
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/gateway/LifeController/updateEclectricState")
	@ResponseBody
	public void updateEclectricState(InputObject inputObject, OutputObject outputObject)throws Exception{
		lifeService.updateEclectricState(inputObject, outputObject);
	}
}
